package com.gitee.dolt.core.exception;

import com.gitee.dolt.core.exception.code.ExceptionCode;
import lombok.Getter;
import lombok.Setter;

/**
 * 参数校验异常
 *
 * @author LYH
 */
@Getter
@Setter
public class ValidParamException extends BizException {

    private String target;
    private String field;
    private Object rejectValue;

    public ValidParamException(String target, String field, Object rejectValue, String msg) {
        super(ExceptionCode.BASE_VALID_PARAM.build(msg));
        this.target = target;
        this.field = field;
        this.rejectValue = rejectValue;
    }

    public ValidParamException(String field, Object rejectValue, String msg) {
        this(null, field, rejectValue, msg);
    }

    public ValidParamException(String field, String message) {
        this(field, null, message);
    }


}
